package swing;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.EventQueue;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EmptyBorder;

public class JScrollPaneDemo01 extends JFrame {

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JScrollPaneDemo01 frame = new JScrollPaneDemo01();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JScrollPaneDemo01() {
		JFrame frame=new JFrame("welcome to mldn");
		Container cont=frame.getContentPane();
		String picPath="d:/217647a8bee7c88e9efb4a11cd2b34e6_175.jpg";
		Icon icon=new ImageIcon(picPath);
		JPanel pan=new JPanel();
		JLabel lab=new JLabel(icon);
		pan.add(lab);
		JScrollPane scr1=null;
		scr1=new JScrollPane(pan,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		cont.add(scr1);
		frame.setSize(230, 120);
		frame.setLocation(300, 200);
		frame.setVisible(true);
		
	}

}
